<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>天截选课系统</title>
    <link href="assets/css/Icons.css" rel="stylesheet">
    <!-- Bootstrap Styles-->
    <link href="assets/css/bootstrap.css" rel="stylesheet" />
    <!-- FontAwesome Styles-->
    <link href="assets/css/font-awesome.css" rel="stylesheet" />
    <!-- Custom Styles-->
    <link href="assets/css/custom-styles.css" rel="stylesheet" />
    <!-- Google Fonts-->
    <link href='assets/css/Sans.css' rel='stylesheet' type='text/css' />
    <link rel="stylesheet" href="assets/js/Lightweight-Chart/cssCharts.css">
    <link rel="stylesheet" href="assets/plugins/element-ui/index.css" />
    <style>
        #page-wrapper{
            margin: 0;
            padding: 0;
            top:0;
            min-height: 100vh !important;
        }
        .line{
            width: 100%;
            height: 1px;
            background: #ccc;
            margin:10px 0;
        }
        #context{
            width: 50%;
            text-align: center;
            height: 80vh;
            margin: 0 auto;
            margin-top: 20px;
            overflow: scroll;
        }
        .list-item{
            width: 90%;
            margin-bottom: 50px;
        }
        .list-item .date-tiem{
            margin-bottom: 5px;
        }
        .message-box{
            background: #fff;
            padding: 20px;
            border-radius: 20px;
            text-align: left;
        }
        .message-box .title{
            color: #000;
            font-weight: bold;
            font-size: 20px;
        }
        .message-box .line-text{
            padding: 5px 0;
        }
    </style>
</head>

<body>
<div id="wrapper">
    <div id="page-wrapper">
        <div class="header">
            <h1 class="page-header">
                选课结果
            </h1>
            <ol class="breadcrumb">
                <li><a href="#">Home</a></li>
                <li><a href="#">message</a></li>
            </ol>
        </div>
        <div id="context">

            <div class="list-item" v-for="item in list"> <!--循环选课结果数据-->
                <div class="date-tiem">{{item.createTime}}</div>
                <div class="message-box">
                    <div class="title">选课结果提醒</div>
                    <div class="line"></div>
                    <div class="line-text">{{item.studentName}}同学，你已成功选课：</div>
                    <div class="line-text">
                        <span>课程名称：</span>
                        <span>{{item.courseName}}</span>
                    </div>
                    <div class="line-text">
                        <span>主讲老师：</span>
                        <span v-if="item.courseMainTeacher">{{item.courseMainTeacher}}</span>
                        <span v-else>暂未安排主讲老师</span>
                    </div>
                    <div class="line-text">
                        <span>任课老师：</span>
                        <span v-if="item.teacherList">{{item.teacherList}}</span>
                        <span v-else>暂未安排主讲老师</span>
                    </div>
                    <div class="line-text">
                        <span>开始日期：</span>
                        <span>{{item.beginTime}}</span>
                    </div>
                    <div class="line-text">
                        <span>结束日期：</span>
                        <span>{{item.endTime}}</span>
                    </div>
                </div>
            </div>

        </div>
    </div>
    <!-- /. PAGE INNER  -->
</div>
<!-- /. PAGE WRAPPER  -->
</div>
<!-- /. WRAPPER  -->
<!-- JS Scripts-->
<!-- jQuery Js -->
<script src="assets/js/jquery-1.10.2.js"></script>
<!-- Bootstrap Js -->
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/vue.js"></script>
<script src="assets/plugins/element-ui/index.js"></script>
<script>
    var vm = new Vue({
        el: '#wrapper',
        data() {
            return {
                list:[{
                    "id": 4,
                    "msg": "0",
                    "createTime": "2022-09-12 22:39:11",
                    "studentId": 20190001,
                    "courseId": 1,
                    "studentName": "张三",
                    "courseName": "Oracle数据库管里",
                    "beginTime": "2022/9/1",
                    "endTime": "2022/12/30",
                    "courseMainTeacher": "张晓峰32",
                    "teacherList": "花田章 季天筹 刘桂新 "
                }]
            }
        },
        mounted() {
            this.getNumber();
        },
        methods: {
            getNumber() {
                var $this = this;
                $.ajax({
                    url:"/message/getAll",
                    dataType: "json",
                    type:"get",
                    async: "false",
                    success(data){
                        console.log(data)
                        $this.list = data.data.list;
                    },
                    error(){

                    }
                })
            }
        }
    });
</script>

</body>

</html>